
// #ifndef VUE3
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue' 
import util from "./common/tools/utils.js";
import uviewPlus,{setConfig } from '@/uni_modules/uview-plus/index.js';
import * as Pinia from 'pinia';
 
import {usePageStore} from "./common/tools/store.js"

// #ifdef H5  
//H5平台通过index.html里面获取siteinfo
var siteInfo = window.siteinfo || {	 
			    "uniacid": "3",
			    "acid": "3",
			    "multiid": "3",
			    "version": "1.0.1",
			    "siteroot": "http://ims.siyueweb.cn/app/index.php",
			    'method_design': '3', 	
				'openid': 3,
			} /*调试时候这样用*/
// #endif 
//微信小程序里面通过require获取siteinfo
// #ifdef MP-WEIXIN 
const siteInfo = require('./siteinfo.js');
// #endif 
//修改uviewplus的配置
// setConfig({config:{unit: 'rpx'}});
 
export function createApp() {
  const app = createSSRApp(App) 
  app.use(Pinia.createPinia());
  app.use(uviewPlus);
 
  app.use({
	  install(Vue){
		  const ee = usePageStore();
		  //导入全局store  
		  ee.setConfig ( siteInfo ); 
		  ee.initdata();
		  //挂载到Vue属性		  
		  Vue.config.globalProperties.ee = ee;
		  Vue.config.globalProperties.kbutil = util;
		  
	  }
  })
   
  return {
    app,
	Pinia,
  }
}
// #endif